package com.resource.exammanage.service.impl;

import com.resource.common.utils.PageUtils;
import com.resource.common.utils.Query;
import com.resource.exammanage.entity.TExamInformationDetailEntity;
import com.resource.exammanage.entity.TExamInformationEntity;
import com.resource.exammanage.mapper.TExamInformationDetailDao;
import com.resource.exammanage.service.TExamInformationDetailService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


@Service("tExamInformationDetailService")
public class TExamInformationDetailServiceImpl extends ServiceImpl<TExamInformationDetailDao, TExamInformationDetailEntity> implements TExamInformationDetailService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TExamInformationDetailEntity> page = this.page(
                new Query<TExamInformationDetailEntity>().getPage(params),
                new QueryWrapper<TExamInformationDetailEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public void saveRelateDetail(TExamInformationEntity tExamInformation) {
        TExamInformationDetailEntity tExamInformationDetail = new TExamInformationDetailEntity();
        tExamInformationDetail.setExamCode(tExamInformation.getExamCode());
        tExamInformationDetail.setExamType(tExamInformation.getExamType());
        tExamInformationDetail.setExamName(tExamInformation.getExamName());
        tExamInformationDetail.setExamContent(tExamInformation.getExamContent());
        this.save(tExamInformationDetail);
    }
}